# -*- coding: utf-8 -*-
"""
@Project: base_python
@File: highs_lows.py
@Author: PC
@Date: 2025/03/18
@Description: 
"""
import csv
from matplotlib import pyplot as plt

filename = 'sitka_weather_07-2014.csv'
with open(filename) as f:
    reader = csv.reader(f) 
    header_row = next(reader) 
    # all_rows=list(reader)
    # for row in all_rows:
    #     print(row)
    highs=[]
    for row in reader:
        highs.append(int(row[1]))
    print(highs)

# 根据数据绘制图形
fig = plt.figure(dpi=128,figsize=(10,6))
plt.plot(highs,c='red') 
# 设置图形的格式
plt.title("Daily high temperatures,July 2014",fontsize=24) 
plt.xlabel('',fontsize=16) 
plt.ylabel("Temperature (F)",fontsize=16)
plt.tick_params(axis='both',which='major',labelsize=16)
plt.show()